<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        
       
        
     <?php
     
        include_once './Data/MySql.php';
        include_once './Data/ForoData.php';
        include_once './Common/Entity/Foro.php';
        include_once './Common/Entity/Imagen.php';
        include_once './Data/RecursosData.php';
     
     $foroData = new ForoData();
     $recursosData = new RecursosData();
     $foro = new Foro();
     $imagen = new Imagen();
     $db = new MySql();
     $consulta= $foroData->GetComentarios($_GET['reto']);
 
     while($resultado=$db->fetch_array($consulta)){
          
          $foro->setIdComentario($resultado['id_comentario']);
          $foro->setComentario($resultado['comentario']);
          $foro->setFecha($resultado['fecha']);
          $foro->setNombre($resultado['nombre']);
         ?>
         <div class="content">
        <div id="comments">
        <h2>Comments</h2>
        <ul class="commentlist">
          <li class="comment_odd">
              <div class="author"><img class="avatar" src="images/demo/avatar.gif" width="32" height="32" alt="" /><span class="name"><a href="#"><?= $foro->getNombre() ?></a></span> <span class="wrote">wrote:</span></div>
            <div class="submitdate"><a href="#"><?= $foro->getFecha() ?></a></div>
            <p><?= $foro->getComentario() ?></p>
          </li></ul>
      </div>
      </div>
        <?php } ?>
            <div class="content">
                <div id="featured">
                    <ul>
                        <li><?php
            include_once './Data/MySql.php';
            include_once './Data/RetoData.php';
            include_once './Data/RecursosData.php';
            include_once './Common/Entity/Reto.php';
            include_once './Common/Entity/Imagen.php';

            $retoData = new RetoData();
            $recursosData = new RecursosData();
            $reto = new Reto();
            $imagen = new Imagen();
            $db = new MySql();

            $reto = $retoData->GetReto($_GET['reto']);
            $imagen = $recursosData->GetImagen($reto->getIdImagen());
            ?>
                            <h2><?= $reto->getTitulo() ?></h2>
                            <p><?= $reto->getDescripcion() ?></p>
                        </li>
                    </ul>

                </div>
            </div>
        
     
      <div id="respond">
        <form action="./Vistas/WebPageSubirImagen.php" method="post" enctype="multipart/form-data">
         <br>
        <p>
            <textarea name="comment" id="comment" cols="100%" rows="10"></textarea>
            <label for="comment" style="display:none;"><small>Comment (required)</small></label>
          </p>
          <p>
            <input name="submit" type="submit" id="submit" value="Submit Form" />
            &nbsp;
            <input name="reset" type="reset" id="reset" tabindex="5" value="Reset Form" />
          </p>
        </form>
      </div>
    </body>
</html>
